<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/modificar_reserva.css">
<title>Modificar reserva</title>
</head>
<body>
	<h1>Modificar reserva</h1>

	<div class="ContenedorPrincipal">

		<div class="cContenedorDerecho">
		
			<div class="cTablaClientes">
				<table border="1">
					<thead>
						<tr>
							<th class="thNombre">Nro. de Reserva</th>
							<th class="thNombre">Destino</th>
							<th class="thNombre">Cantidad pasajeros</th>
							<th class="thNombre">Fecha de reserva</th>
							<th class="thNombre">Precio total</th>
							<th class="thNombre">-</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${ reservas }" var="reserva">
							<tr>
								<td>${ reserva.idReserva }</td>
								<td>${ reserva.getDestino() }</td>
								<td>${ reserva.pasajeros }</td>
								<td>${ reserva.fecha }</td>
								<td>${ reserva.precioTotal }</td>
								<td><a href="<%= request.getContextPath()%>/reserva?reserva=${ reserva.idReserva}
								${ reserva.getUrlPaquete() }${ reserva.getUrlClientes() }">Modificar</a></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>

			<div class="cContinuar">
				<div class="cVolver">
					<a href="<%= request.getContextPath()%>/index">Volver</a>
				</div>
			</div>

		</div>
	</div>

</body>
<script type="text/javascript">
	function idReserva() {
		var e = document.getElementById("cbxReservas");
		var idre = e.options[e.selectedIndex].value;
		key = escape("reservas");
		value = escape(idre);
		if(value != 0){
			var kvp = document.location.search.substr(1).split('&');
			if (kvp == '') {
				document.location.search = '?' + key + '=' + value;
			} else {
				var i = kvp.length;
				var x;
				while (i--) {
					x = kvp[i].split('=');

				}
				if (i < 0) {
					kvp[kvp.length] = [ key, value ].join('=');
				}
	
				//this will reload the page, it's likely better to store this until finished
				document.location.search = kvp.join('&');
			}
		}
	}
		   
    window.history.forward();       
    function noBack() {   
       window.history.forward();
    }
</script>
</html>